package com.wangsd.web.face.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 微信分账方实体
 * 提供转JSON使用
 */
@Data
@Entity
@Table(name = "receiver")
@ApiModel(value = "分账账户", description = "分账账户配置信息")
public class Receiver implements Serializable {

    @Id
    @TableId(type = IdType.AUTO)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedTime;

    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

    @ApiModelProperty(value = "分账接收方类型")
    private String type;//分账接收方类型

    @ApiModelProperty(value = "分账接收方账号")
    private String account;//分账接收方账号

    @ApiModelProperty(value = "分账接收方全称")
    private String name;//分账接收方全称

    @ApiModelProperty(value = "与分账方的关系类型")
    private String relation_type;

    @ApiModelProperty(value = "具体关系（N）")
    private String custom_relation;

    //@ApiModelProperty(value = "服务商code")
    private String code;

    @ApiModelProperty(value = "服务商关联id")
    private String serviceBusinessId;

    //@ApiModelProperty(value = "分账金额")
    @Transient
    @TableField(exist = false)
    private Integer amount;//分账金额

    //@ApiModelProperty(value = "分账描述")
    @Transient
    @TableField(exist = false)
    private String description;//分账描述

    @ApiModelProperty(value = "服务商名称")
    @Transient
    @TableField(exist = false)
    private String businessServiceName;
}
